package sourismobile.server.module;

import java.awt.AWTException;
import java.awt.Robot;

import sourismobile.server.core.Module;

public class SourisMobilePresenter extends Module {
	
	Robot robot;

	public SourisMobilePresenter() {
		try {
			robot = new Robot();
		} catch (AWTException e) {
			e.printStackTrace();
		}
	}
	
	public boolean move(int direction) {
		robot.keyPress(direction);
		return true;
	}
	
	public boolean action(int param) {
		
		switch (param) {
		case 5: // right
			return move(0x27);
		case 2: // left
			return move(0x25);
		}
		return false;
	}
}
